﻿using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using System.Threading;

namespace CenterDateAchieve.Test
{

    [TestFixture]
    public class TestThread
    {
        [Test]
        public void testThread()
        {
            ThreadManager();
        }
        private void ThreadManager()
        {
            //ThreadPool.SetMaxThreads(2, 1); 
            //for (int i = 0; i < 10; i++)
            //{
            //    // ThreadPool pool=new
            //    ThreadPool.QueueUserWorkItem(new WaitCallback(Wafadf), i);
            //}
            PrintManager m = new PrintManager();
            //Thread t=new Thread(new ThreadStart(m.Execute));
            m.OnStart();
             
            
            //Console.WriteLine(t.ThreadState);
            //t.Join();
            //Console.WriteLine(t.ThreadState);
            //int k = 0;
            //for (int i = 0; i < 1000; i++)
            //{
            //    Console.WriteLine(i);
            //    k++;
            //}
            //if (k >= 100)
            //    m.OnStop();
        }

        //public void Wafadf(object o)
        //{
        //    int threadNumber = (int)o;
           
        //        //Interlocked.Increment(
        //    Console.WriteLine("Thread {0}:{2} reporting for duty.{1}", threadNumber, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss fff"), Thread.CurrentThread.GetHashCode());
        //    //Thread.Sleep(threadNumber);
        //}
    }
}
